<%-- 
    Document   : db3
    Created on : 2014/8/19, 下午 02:40:02
    Author     : gjun
--%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.DriverManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb","root","root");
Statement st=con.createStatement();

String sql="delete from person where id=('x')";
int x=st.executeUpdate(sql);
System.out.println("x");
st.close();
con.close();
%>


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>刪除資料</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <%=  x  %>
    <td><a href="list.jsp?id=<%= id %>">刪除</a></td>
    </body>
</html>
